package god;

import java.util.Scanner;

public class J10Circle {
	public static void main(String[] args) {
		final double PI = 3.14;
		double radius = 0, area = 0, perimeter = 0;

		radius = inputCircle( makeScanner() );
		area = getArea(radius, PI);
		perimeter = getPerimeter(radius, PI);

		System.out.println("원의 면적 = " + area);
		System.out.println("원의 둘레 = " + perimeter);
	}
	
	public static Scanner makeScanner() {
		Scanner sc = new Scanner(System.in);
		return sc;
	}
	
	public static void closeScanner(Scanner sc) {
		sc.close();
	}

	private static double inputCircle( Scanner sc ) {
		double radius;
		System.out.println("반지름을 입력해 주세요");
		radius = sc.nextDouble();
		closeScanner(sc);
		return radius;
	}
	private static double getArea(double radius, double PI) {
		return radius * radius * PI;
	}

	private static double getPerimeter(double radius, double PI) {
		return radius * 2 * PI;

	}

}
